package com.example.disinfestation.mapper;

import com.example.disinfestation.entity.Order;

import java.util.Date;
import java.util.List;

import com.example.disinfestation.entity.example.OrderExample;
import org.apache.ibatis.annotations.Param;

public interface OrderMapper {
    int countByExample(OrderExample example);

    int deleteByExample(OrderExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Order record);

    int insertSelective(Order record);

    List<Order> selectByExample(OrderExample example);

    Order selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Order record, @Param("example") OrderExample example);

    int updateByExample(@Param("record") Order record, @Param("example") OrderExample example);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);

//    void generateOrder(@Param("orderNum") String orderNum, @Param("header")String header, @Param("photo")String photo,
//                       @Param("money")String money, @Param("timess")String timess, @Param("username")String username, @Param("phone")String phone,@Param("region")String region,
//                       @Param("address")String address, @Param("createtime")Date createtime, @Param("pid")Integer pid, @Param("openId")String openId);

    //创建订单信息
    void generateOrder(String orderNum, String header, String photo,String artice,
                       String money, String timess, String username, String phone,String region,
                       String address, Date createtime, Integer pid, String openId,String complete);


    //根据openID查询该用户的全部订单信息
    List<Order> selectByOpenId(String openId);

    /*取消订单*/
    void updateById(Integer id, Integer ordertype);

    void deleteById(Integer id);



    /*支付完成，修改订单状态*/
    void updateByOrdersNum(@Param("ordersNum") String ordersNum, @Param("ordertype") Integer ordertype, @Param("zhifutime") Date zhifutime,@Param("complete") String complete);

    /*取消邓丹，更改订单状态*/
    void updateRefundByOrdersNum(String ordersNum, Integer ordertype, Date refundtime,String complete);
}